package com.woniu.woniuproject.service;

import com.woniu.woniuproject.entity.User;
import com.woniu.woniuproject.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 功能描述:<br>
 * 〈〉
 *
 * @author EDZ
 * @create 2020/11/19
 * @since 1.0.0
 */
@Service
public class UsersService {
    @Autowired
    UserMapper userMapper;

    public User queryUserByName(String account) {

        return userMapper.selectByName(account);
    }

    public int addUser(User ur) {
        return userMapper.insert(ur);
    }

    public int updateBypass(String username,String newpass) {
        return userMapper.updateBypass(username,newpass);
    }

    public User queryUserByemail(String username, String email) {
        return userMapper.selectByemail(username,email);
    }
}
